<?php
$id=$_GET['id'];
include_once($_SERVER["DOCUMENT_ROOT"].'/home/public/header.php');

if(!isset($_SESSION['user'])){
  echo '<script>alert("请登录后再评论!!!");window.location.href="/home/denglu/login.php"</script>';
   } 




include_once($_SERVER["DOCUMENT_ROOT"].'/public/func.php');
$config=include_once($_SERVER["DOCUMENT_ROOT"].'/public/config.php');
$rew=sel($config,'`guanli`','where id='.$id.'');
$re=sel($config,'lanmu`','order by addtime desc limit 0,5');
$er=sel($config,'`pinglun`','where wid='.$id.' order by addtime desc');
$a=$_SESSION['user'];
?>
<script type="text/javascript" charset="utf-8" src="/public/biadu/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/biadu/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/public/biadu/lang/zh-cn/zh-cn.js"></script>
<article class="blogs">
  <h1 class="t_nav">
  </span><a href="/" class="n1">网站首页</a>
  <a href="/" class="n2">文章详情</a></h1>
  <div class="index_about">
    <h2 class="c_titile"><?php echo $rew[0]['title']; ?></h2>
    <p class="box_c">
    <span class="d_time">发布时间：<?php echo $rew[0]['addtime']; ?></span>
    <span>编辑：董佩</span>
    <span>qq：**********</a></span></p>
    <ul class="infos">
      <p><?php echo $rew[0]['content']; ?></p>
    </ul>
    <div class="keybq">
    <p><span>标签：</span><?php echo $rew[0]['biao']; ?></p>

    </div>
    <p><span>评论区</span></p>


<?php  
foreach ($er as $v) {
 echo '
    <p class="dateview"> <span> 发布时间：'.$v['addtime'].'</span>
    <p class="dateview"> <span> 评论人：'.$v['author'].'</span>
     <ul class="nlist">
       <p>'.$v['content'].'</p>
     </ul>
     <div class="line"></div></P>
    ';
}

// echo page($config,'pinglun');
?>




    <div class="result-wrap">
            <div class="result-content">
                <form action="add.php?id=<?php echo $id;?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
                              <tr>
                              <td>
                                    <input class="common-text required" id="title" name="author" size="50" style="margin:20px auto;" value="<?php echo $a;?>" type="hidden">
                                </td>
                              </tr>

                            <tr>
                                <th>评论：</th>
                                <td><textarea name="content" class="common-textarea" id="content" cols="30" style="margin: 40px; width:80%;" rows="10"></textarea></td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
                                <input type="hidden" name="wid" value="<?php echo $id;?>">
                                    <input style="margin: auto 20%;" class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody>
                        </table>
                </form>
            </div>
        </div>
    <div class="ad"> </div>
  </div>
  <aside class="right">
    <!-- Baidu Button BEGIN -->
    <div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare">
    <a class="bds_tsina"></a>
    <a class="bds_qzone"></a>
    <a class="bds_tqq"></a>
    <a class="bds_renren"></a>
    <span class="bds_more"></span>
    <a class="shareCount"></a></div>
    
    <!-- Baidu Button END -->
    <div class="blank"></div>
    <div class="news">
      <h3>
        <p>栏目展示</p>
      </h3>
      <ul class="rank">
      <?php
      foreach ($re as $v) {
        echo '<li><a href="/" title="lan" target="_blank">'.$v['lan'].'</a></li>';
      }?>
      </ul>
    </div>
  
  </aside>
</article>
<?php
include_once($_SERVER["DOCUMENT_ROOT"].'/home/public/footer.php');
?>